﻿using System;
using DBProvider;
using DBProvider.Providers;

namespace HealthCommunity
{
	public partial class CourseDetail : System.Web.UI.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			if(!IsPostBack)
			{
				var theCourse = GetCourse();

				ltrCourseName.Text = theCourse.CourseName;
				this.Title = theCourse.CourseName;
			}
		}

		private Course GetCourse()
		{
			Course result = null;

			if(CommonHelper.QueryStringInt("courseid") > 0)
			{
				var courseProvider = new CourseProvider();

				result = courseProvider.GetCourse(CommonHelper.QueryStringInt("courseid"));
			}

			return result;
		}
	}
}